useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.5.0_11'

		##Check out
	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin')
		#commonBits.setRecordLayout(select, 'ams Store')
		click('Edit1')
		select('Table', 'rows:[2,3,4,5,6,7,8],columns:[4|Loc_Name]')
		select_menu('Data>>Table View #{Selected Records#}')
##		select('Table2', 'rows:[2,3,4,5,6,7,8],columns:[4|Loc_Name]')
		select('Table', 'rows:[1,2,3],columns:[3|Loc_Type]')
		select_menu('Edit>>Copy Record#{s#}')
		select('Table', 'cell:3|Loc_Type,5(ST)')
		select_menu('Edit>>Paste Record#{s#}')
		select('Table', 'cell:5|Loc_Addr_Ln1,5(Building B,  Portside DC)')
		assert_p('Table', 'Text', 'Building B,  Portside DC', '5|Loc_Addr_Ln1,5')
		select('Table', 'cell:5|Loc_Addr_Ln1,5(Building B,  Portside DC)')
		rightclick('Table', '4|Loc_Name,5')
		select_menu('Edit Record')
##		select('Table1', 'cell:5|Loc_Addr_Ln1,5(Building B,  Portside DC)')
		select('Table', 'cell:Data,5(2-8 Mc Pherson Street)')
		assert_p('Table', 'Text', 'cell:Data,5(2-8 Mc Pherson Street)')
		select('Table', 'cell:Data,5(2-8 Mc Pherson Street)')
		click('Right')
		select('Table', 'cell:Data,3(WA Ad Support)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5866, 5866], [Loc_Type, 3, , DC, DC], [Loc_Name, 4, , WA Ad Support, WA Ad Support], [Loc_Addr_Ln1, 5, , , ], [Loc_Addr_Ln2, 6, , , ], [Loc_Addr_Ln3, 7, , , ], [Loc_Postcode, 8, , , ], [Loc_State, 9, , , ], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,3(WA Ad Support)')
		click('Right')
		select('Table', 'cell:Data,5(Unit 2, 39-41 Allingham Street)')
		assert_p('Table', 'Text', 'Unit 2, 39-41 Allingham Street', 'Data,5')
		select('Table', 'cell:Data,4(Bankstown)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5015, 5015], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Bankstown, Bankstown], [Loc_Addr_Ln1, 5, , Bankstown, Bankstown], [Loc_Addr_Ln2, 6, , Unit 2, 39-41 Allingham Street, Unit 2, 39-41 Allingham Street], [Loc_Addr_Ln3, 7, , Condell Park, Condell Park], [Loc_Postcode, 8, , 2200, 2200], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,4(Bankstown)')
		click('Right')
		select('Table', 'cell:Data,4(Penrith)')
		assert_p('Table', 'Text', 'cell:Data,4(Penrith)')
		select('Table', 'cell:Data,5(58 Leland Street)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5019, 5019], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Penrith, Penrith], [Loc_Addr_Ln1, 5, , Penrith, Penrith], [Loc_Addr_Ln2, 6, , 58 Leland Street, 58 Leland Street], [Loc_Addr_Ln3, 7, , Penrith, Penrith], [Loc_Postcode, 8, , 2750, 2750], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,5(58 Leland Street)')
		click('Right')
		select('Table', 'cell:Data,5(Cnr. Urunga Pde & The Kingsway)')
		assert_p('Table', 'Text', 'Cnr. Urunga Pde & The Kingsway', 'Data,5')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		assert_p('Table', 'Content', '[[Brand_Id, 1, , TAR, TAR], [Loc_Nbr, 2, , 5037, 5037], [Loc_Type, 3, , ST, ST], [Loc_Name, 4, , Miranda, Miranda], [Loc_Addr_Ln1, 5, , Westfield Shoppingtown, Westfield Shoppingtown], [Loc_Addr_Ln2, 6, , Cnr. Urunga Pde & The Kingsway, Cnr. Urunga Pde & The Kingsway], [Loc_Addr_Ln3, 7, , Miranda, Miranda], [Loc_Postcode, 8, , 2228, 2228], [Loc_State, 9, , NSW, NSW], [Loc_Actv_Ind, 10, , A, A]]')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,6(WA Ad Support)')
		select('Table', 'rows:[6,7],columns:[4|Loc_Name]')
		select_menu('Edit>>Delete Record#{s#}')
		select('Table', 'cell:4|Loc_Name,5(Rockdale)')
		rightclick('Table', '4|Loc_Name,5')
		select_menu('Edit Record')
##		select('Table1', 'cell:4|Loc_Name,5(Rockdale)')
		select('Table', 'cell:Data,4(Building B,  Portside DC)')
		assert_p('Table', 'Text', 'Building B,  Portside DC', 'Data,4')
		select('Table', 'cell:Data,4(Building B,  Portside DC)')
		click('Right')
		select('Table', 'cell:Data,4(Penrith)')
		select('Table', 'cell:Data,5(58 Leland Street)')
		select('Table', 'cell:Data,5(58 Leland Street)')
		click('Right')
		select('Table', 'cell:Data,1(5037)')
		#assert_p('Table', 'Text', '5015', 'Data,1')
		assert_p('Table', 'Text', '5037', 'Data,1')

		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		select('Table', 'cell:Data,4(Westfield Shoppingtown)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		select('Table', 'cell:4|Loc_Name,4(Blacktown)')
		select('Table', 'cell:4|Loc_Name,4(Blacktown)')
		#assert_p('Table', 'RowCount', '10')
		assert_p('Table', 'RowCount', '8')

		select('Table', 'cell:4|Loc_Name,4(Blacktown)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		#click('WindowsInternalFrameTitlePane', 876, 14)
		click('BasicInternalFrameTitlePane$NoFocusButton2')

		if window('Save Changes to file: ' + commonBits.sampleDir() + 'Ams_LocDownload_20041228.bin'):
			click('No')
		close()
	close()
